/* Copyright (C) 2010 Fredrique Samuels, fredriquesamuels@gmail.com 

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef TRI_LOGGING_H_
#define TRI_LOGGING_H_

#include <string>
#include <time.h>
#include <math.h>
#include <iostream>
#include <fstream>


namespace tri{


enum {
	INFO,
	WARNING,
	SEVERE
};

class Logging{
public:
	static std::fstream LOG;
	static int mLogLevel;
	static std::string mLogFile;
	static bool mPrintToConsole;
	
};

/**
 * Set the logging file. Default file is called log.txt
 *
 * @param file Destination log file 
 */
void setLoggingFile(std::string file);

/**
 * Set the logging file. Default file is called log.txt
 *
 * @param file Destination log file 
 */
void setLoggingFile(std::string file);

/**
 * Set Flag to pring logs out to console
 */
void printLogsToConsole(bool b);

/**
 * Set log level
 * INFO : All logs are written to file.
 * WARNING : Only warnings and SEVERE logs are written to file
 * SEVERE : Only SEVERE logs are written to file.
 *
 * @param level 
 */
void setLoggingLevel(int level);

/**
 * Log an INFO message
 * @param msg Message to log
 */
void LOG_INFO(std::string msg);

/**
 * Log an INFO message
 * @param msg Message to log
 */
void LOG_WARNING(std::string msg);

/**
 * Log an SEVERE message
 * @param msg Message to log
 */
void LOG_SEVERE(std::string msg);

}

#endif /*LOGGING*/
